<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-model</title>
</head>
<body>
    <div id="app">
        <button @click="print">print</button>
        <button @click="assign">assign</button>
        <input type="text" v-model="message">
        <h2>{{message}}</h2>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el:'#app',
            data:{
                message:'nishishabi'
            },
            methods:{
                print:function () {
                    alert(this.message);
                },
                assign:function () {
                    this.message='fish'
                }
            }
        })
    </script>
</body>
</html>